﻿@using CarCareTracker.Helper
@inject IConfigHelper config
@inject ITranslationHelper translator
@{
    var userConfig = config.GetUserConfig(User);
    var userLanguage = userConfig.UserLanguage;
}
@model List<UploadedFiles>
<label id="documentsPendingUploadLabel">@translator.Translate(userLanguage, "Documents Pending Upload")</label>
<ul class="list-group" id="documentsPendingUploadList">
    @foreach (UploadedFiles filesUploaded in Model)
    {
        <li class="list-group-item">
            <div class="d-flex justify-content-between">
                <a style="cursor:pointer;" class="uploadedFileName d-flex align-items-center text-truncate" title="@filesUploaded.Name" onclick="openAttachmentPreview('@filesUploaded.Name', '@filesUploaded.Location')">
                    <span class="lead me-2"><i class="bi @StaticHelper.GetIconByFileExtension(filesUploaded.Location)"></i></span><span class="text-link">@filesUploaded.Name</span>
                </a>
                <div class="d-flex align-items-center">
                    <button type="button" class="btn btn-sm btn-outline-secondary me-2" onclick="editFileName('@filesUploaded.Location', this)"><i class="bi bi-pencil"></i></button>
                    <button type="button" class="btn btn-sm btn-outline-danger" onclick="deleteFileFromUploadedFiles('@filesUploaded.Location', this)"><i class="bi bi-trash"></i></button>
                </div>
            </div>
        </li>
    }
</ul>